Skip to content

Adding the possibility to drive a stepper motor - #5

Merged
seb5g merged 4 commits into
PyMoDAQ:5.0.xfrom
jerlfan:main
Oct 13, 2026
Merged

seb5g merged 4 commits into
PyMoDAQ:5.0.xfrom
jerlfan:main

Conversation

@jerlfan

@jerlfan jerlfan commented Apr 27, 2025

Copy link
Copy Markdown
Contributor
  1. Added a pyproject.toml and hatch_build and removing setup.py to follows the new template style.
  2. Adding methods to arduino_telemetrix: initialize_stepper_motor, move_stepper_to_position, get_stepper_position
  3. creating daq_move_StepperMotor
  4. config.template.toml updated with stepper
  5. stepper_absolute.py and test_dtepper_class.py have been used to developed. They can be removed in the future.

To be improved:

  • axis management: each axis (motor) is defined by a set of 3 pins

Known issue:

  • move_home doesn't work porperly. It moves but does not update the current_position
  • at initialisation units are meters by default. The 'm' must be remove.

@seb5g
seb5g changed the base branch from main to 5.0.x May 22, 2025 09:44
@seb5g
seb5g changed the base branch from 5.0.x to main May 22, 2025 09:45
@seb5g

seb5g commented May 22, 2025 •

Copy link
Copy Markdown
Contributor

Hi @jerlfan , there was already a branch (the main one actually) called 5.x that implemented the pyproject layout. Could you check/change your PR to use this one as the base branch (see the edit tab on right top of your PR)

@seb5g

seb5g commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

@jerlfan could you try and do what I proposed?

@jerlfan
jerlfan changed the base branch from main to 5.0.x October 12, 2026 18:44
@jerlfan
jerlfan marked this pull request as draft October 12, 2026 19:46
@jerlfan

jerlfan commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Hello Sébastien,

Done: I rebuilt the branch on top of 5.0.x, keeping only the stepper motor additions (arduino_telemetrix.py, config_template.toml and the new daq_move_StepperMotor.py). The actuator now follows the PyMoDAQ 5 interface (DataActuator, per-axis units and epsilons), which also fixes the two known issues listed above: the default unit and move_home not updating the position. check_plugin reports it as OK, and the unit is correctly displayed.

I have not been able to test it on the hardware yet, so I converted the PR to draft. I will test it with the Arduino and mark it as ready for review afterwards.

Thanks!
Jérémie

Note: check_plugin still reports a few warnings on files I did not touch (daq_move_LED, daq_move_LEDwithLCD, daq_move_Servo, color_synthesizer, and extensions = false in pyproject.toml while the package has code in extensions). I left them out of this PR to keep it focused on the stepper motor.

@jerlfan
jerlfan marked this pull request as ready for review October 13, 2026 06:21
@jerlfan

jerlfan commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

Tested on the hardware (Arduino Uno with a NEMA17 motor): initialization, absolute and relative moves, and homing all work, and the position is correctly updated. The PR is ready for review.

@seb5g seb5g left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty good stuff! Some remarks on the syntax. One question on the async possibilities (always good to be able to stop a motor in case it may crash into somethng...)

Comment thread src/pymodaq_plugins_arduino/daq_move_plugins/daq_move_StepperMotor.py Outdated
Comment thread src/pymodaq_plugins_arduino/daq_move_plugins/daq_move_StepperMotor.py Outdated
Comment thread src/pymodaq_plugins_arduino/daq_move_plugins/daq_move_StepperMotor.py Outdated
Comment thread src/pymodaq_plugins_arduino/hardware/arduino_telemetrix.py Outdated
@jerlfan
jerlfan requested a review from seb5g October 13, 2026 10:10
@seb5g
seb5g merged commit 71201b4 into PyMoDAQ:5.0.x Oct 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants